package component;

import lombok.Data;
import lombok.ToString;

@Data
@ToString
public abstract class MenuComponent {

    protected String name;
    protected int level;

    //添加子菜单
    public void add(MenuComponent menuComponent){
        throw new UnsupportedOperationException();
    }

    //移除子菜单
    public void remove(MenuComponent menuComponent){
        throw new UnsupportedOperationException();
    }

    //获取指定的子菜单
    public MenuComponent getChild(int index){
        throw new UnsupportedOperationException();
    }

    //打印菜单
    public abstract void print();
}
